// src/router/modules/order.js
import Layout from '@/layout/index.vue'

export default [
  {
    /* 顶级父路由：所有订单 */
    path: '/orders',
    component: Layout,
    redirect: '/orders/delivery',          // 进入 /orders 默认到列表
    name: 'Orders',
    meta: { title: '订单管理', icon: 'list' },

    children: [
      {
        /* 列表页：/orders/delivery */
        path: 'delivery',
        name: 'AllOrderList',
        component: () => import('@/views/order/delivery/AllOrderList.vue'),
        meta: { title: '全量订单', keepAlive: true }
      },

      {
        /* 详情页：/orders/delivery/123 */
        path: 'delivery/:id(\\d+)',
        name: 'OrderDetail',
        component: () => import('@/views/order/delivery/OrderDetail.vue'),
        props: true,
        hidden: true,                              // 不挂菜单
        meta: {
          title: '订单详情',
          activeMenu: '/orders/delivery',          // 左侧仍高亮“全量订单”
          noCache: true
        }
      },
        /* 追踪页  ── /orders/delivery/track/123 */
      {
        path: 'delivery/track/:id(\\d+)',
        name: 'OrderTrack',
        component: () => import('@/views/order/delivery/OrderTrack.vue'),
        props: true,
        hidden: true,
        meta: { title: '订单追踪', activeMenu: '/orders/delivery', noCache: true }
      }
    ]
  }
]
